package com.zjkj.mp.service.notice.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zjkj.mp.dao.notice.NoticeDAO;
import com.zjkj.mp.service.notice.NoticeManager;
import com.zjkj.mp.utils.PaginatedResult;
import com.zjkj.mp.vo.notice.Notice;

@Service
public class NoticeManagerImpl implements NoticeManager{

	@Autowired
	NoticeDAO noticeDAO;
	
	@Override
	public PaginatedResult getList(int pageNo, int pageSize,
			Map<String, Object> params) {
		if(params == null){
			params = new HashMap<String, Object>();
		}
		return this.noticeDAO.getList(pageNo, pageSize, params);
	}

	@Override
	public void createNotice(Notice notice) {
		 noticeDAO.addNotice(notice);
	}

	@Override
	public void updateNotice(Notice notice) {
		 noticeDAO.updateNotice(notice);
	}

	@Override
	public void deleteNotice(int id) {
		noticeDAO.deleteNotice(id);
	}

	@Override
	public Notice getNoticeById(int parseInt) {
		return this.noticeDAO.getById(parseInt);
	}

}
